<template>
    <!-- 银保通核对工作列表模块 -->
    <div class="fillcontain">
        <!-- 查询条件 -->
        <div class="fastQuery">
            <el-row>
                <el-col :span="2" class="fastQuery_title"><i class="el-icon-tickets"></i><span> 查询条件</span></el-col>
                <el-col :span="10">
                    <!--<el-badge :value="warnCount" class="item fastQuery_item">
                        <el-button size="small" :class="{isActive:searchParams.queryType == 'WARN'}"
                                   @click="searchParams.queryType = 'WARN';getList(); ">预警
                        </el-button>
                    </el-badge>
                    <el-badge :value="paginations.total" class="item fastQuery_item" type="warning">
                        <el-button size="small" :class="{isActive:searchParams.queryType == 'TODO'}"
                                   @click="searchParams.queryType = 'TODO';getList();">全部
                        </el-button>
                    </el-badge>-->
                </el-col>
                <el-col :span="4" class="moreCondition">
                    <span v-if="!isShow" @click="showorhide">更多条件 <i class="el-icon-d-arrow-right"></i></span>
                    <span v-if="isShow" @click="showorhide">收起 <i class="el-icon-d-arrow-left"></i></span>
                </el-col>
                <el-col :span="8"></el-col>
            </el-row>
        </div>
        <!-- 查询表单 -->
        <el-form v-show="isShow" :model="searchParams" :rules="rules" ref="ruleForm" label-width="120px"
                 class="search_container">
            <el-row>
                <el-col :span="6">
                    <el-form-item label="分支公司" prop="scompanyid">
                        <el-select clearable v-model="searchParams.scompanyid" placeholder="分支公司">
                            <el-option v-for="(key,value) in ssyMap" :key="key.sorgid" :label="key.sorgname"
                                       :value="key.sorgid"></el-option>
                        </el-select>
                    </el-form-item>
                </el-col>
                <el-col :span="6">
                    <el-form-item label="险种类型" prop="srisk">
                        <el-select clearable v-model="searchParams.srisk" placeholder="险种类型">
                            <el-option v-for="item in bankRiskType" :key="item.value" :label="item.label"
                                       :value="item.label"></el-option>
                        </el-select>
                    </el-form-item>
                </el-col>
                <el-col :span="6">
                    <el-form-item label="受理号" prop="caseno">
                        <el-input clearable v-model="searchParams.caseno" placeholder="受理号"></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="6">
                    <el-form-item label="保单号" prop="schdrnum">
                        <el-input clearable v-model="searchParams.schdrnum" placeholder="保单号" ></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="6">
                    <el-form-item label="组号" prop="sgroupno">
                        <el-input clearable v-model="searchParams.sgroupno" placeholder="组号" ></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="6" class="text_center">
                    <el-button type="primary" icon="el-icon-search" @click="subGetList"></el-button>
                    <el-button type="primary" plain icon="el-icon-refresh" @click="resetSearch"></el-button>
                </el-col>
            </el-row>

        </el-form>

        <div class="contain">
            <!-- 操作按钮 -->
            <el-row>
                <el-col :span="24" class="pb15 pt5">
                    <div v-if="showNext" style="display: inline;">
                        <el-button type="danger" style="margin-left: 10px;" plain v-for="(value,key) in nextNodeMap"
                                   :key="key" @click="exchangeNode(key)">{{nextNodeMap[key].destNodeName}}
                        </el-button>
                        <el-button type="danger" style="margin-left: 10px;"  plain @click="lock()">加锁</el-button>
                        <el-button type="danger"  plain @click="unlock()">解锁</el-button>
                    </div>
                </el-col>
            </el-row>
            <!-- 查询结果列表 -->
            <div class="table_container">
                <el-table ref="multipleTable" v-loading="loading" :data="tableData" tooltip-effect="dark"
                          highlight-current-row header-cell-class-name="table-header-class"
                          @selection-change="handleSelectionChange"
                          :row-style="rowStyle"
                          empty-text="无符合查询条件任务"
                          style="width:100%">
                    <el-table-column type="selection" :selectable="interceptVip"></el-table-column>
                    <el-table-column property="schkousrid" label="检出人" align='center' show-overflow-tooltip min-width="120"></el-table-column>
                    <el-table-column property="remark05" label="外包商" align='center' show-overflow-tooltip min-width="100"></el-table-column>
                    <el-table-column property="scaseno" label="受理号" align='center' show-overflow-tooltip min-width="80"></el-table-column>
                    <el-table-column property="schdrnum" label="保单号" align='center' show-overflow-tooltip min-width="100"></el-table-column>
                    <el-table-column property="sinsured" label="被保人" align='center' show-overflow-tooltip min-width="100"></el-table-column>
                    <el-table-column property="srisk" label="险种类型" align='center' show-overflow-tooltip min-width="100"></el-table-column>
                    <el-table-column property="sinsreqt" label="文件类型" align='center' show-overflow-tooltip min-width="120"></el-table-column>
                    <el-table-column property="sgroupno" label="组号" align='center' show-overflow-tooltip min-width="100"></el-table-column>
                    <el-table-column property="sdepotno" label="存仓号" align='center' show-overflow-tooltip min-width="100"></el-table-column>
                    <el-table-column property="flag03" label="银保通" align='center' :formatter="getIsFlag03" show-overflow-tooltip min-width="80"></el-table-column>
                    <el-table-column property="flag01" label="现金单" align='center' :formatter="getIsFlag01" show-overflow-tooltip min-width="80"></el-table-column>
                    <el-table-column property="sorgname" label="分支公司" align='center'  show-overflow-tooltip min-width="120"></el-table-column>
                    <el-table-column property="sbegintime" label="开始时间" align='center' show-overflow-tooltip min-width="160"></el-table-column>
                    <el-table-column property="remark01" label="多保单标记" align='center' show-overflow-tooltip min-width="100">
                        <template slot-scope="scope">
                            <el-link type="primary" @click="showTwoCaseList(scope.row.staskno,scope.row.scaseno)" v-if="scope.row.remark01 && scope.row.remark01 != ''" :disabled="!interceptVip(scope.row, scope.index)">{{scope.row.remark01}}
                            </el-link>
                        </template>
                    </el-table-column>
                    <el-table-column property="sremark" label="最新备注" align='center' show-overflow-tooltip min-width="120">
                        <template slot-scope="scope">
                            <el-link type="primary" @click="showRemark(scope.row.staskno)" :disabled="!interceptVip(scope.row, scope.index)">{{ scope.row.sremark?scope.row.sremark:'备注' }}</el-link>
                        </template>
                    </el-table-column>
                    <el-table-column property="snodedes" label="状态" align='center' show-overflow-tooltip min-width="120"></el-table-column>
                    <el-table-column property="taskChange" label="处理过程" align='center' show-overflow-tooltip min-width="80">
                        <template slot-scope="scope">
                            <el-link type="primary" @click="showChange(scope.row.staskno)" :disabled="!interceptVip(scope.row, scope.index)">处理过程</el-link>
                            <!-- <span class="operationIcon ml10" @click="showChange(scope.row.staskno)">
                                <i class="el-icon-paperclip"></i>
                            </span> -->
                        </template>
                    </el-table-column>
                    <el-table-column property="taskChange" label="比对结果" align='center' show-overflow-tooltip min-width="80">
                        <template slot-scope="scope">
                            <el-link type="primary"  @click="showComparsion(scope.row.staskno)" :disabled="!interceptVip(scope.row, scope.index)">比对结果</el-link>
                        </template>
                    </el-table-column>
                    <el-table-column property="imageInfo" label="影像信息" align='center' show-overflow-tooltip min-width="80">
                        <template slot-scope="scope" >
                            <span class="operationIcon" @click="showImageList(scope.row.scaseno)" :style="{'pointer-events':!interceptVip(scope.row, scope.index) ? 'none': ''}">
                                <i class="el-icon-camera"></i>
                            </span>
                        </template>
                    </el-table-column>
                    <el-table-column property="imageInfo" label="差错记录" align='center' show-overflow-tooltip min-width="80">
                        <template slot-scope="scope">
                            <el-link type="primary" @click="showErrorInfoList(scope.row.staskno)" :disabled="!interceptVip(scope.row, scope.index)">差错记录</el-link>
                        </template>
                    </el-table-column>
                </el-table>
                <el-row>
                    <el-col :span="24">
                        <div class="pagination">
                            <el-pagination
                                    background
                                    v-if='paginations.total > 0'
                                    :page-sizes="paginations.pageSizes"
                                    :page-size="paginations.pageSize"
                                    :layout="paginations.layout"
                                    :total="paginations.total"
                                    :current-page='paginations.pageIndex'
                                    @current-change='handleCurrentChange'
                                    @size-change='handleSizeChange'>
                            </el-pagination>
                        </div>
                    </el-col>
                </el-row>
            </div>
        </div>
        <!-- 备注-->
        <cdfs-remark-list :taskNo="remarkTaskNo" :drawer="showRemarkFlag" @close="hideRemark"></cdfs-remark-list>
        <!-- 历史备注-->
        <cdfs-his-remark-list :taskNo="hisRemarkTaskNo" :drawer="showHisRemarkFlag" @close="hideHisRemark"></cdfs-his-remark-list>
        <!--流转记录-->
        <cdfs-task-change-list :taskNo="changeTaskNo" :drawer="showChangeFlag" @close="hideChange"></cdfs-task-change-list>
        <!--历史流转记录-->
        <cdfs-his-task-change-list :taskNo="hisChangeTaskNo" :drawer="showHisChangeFlag" @close="hideHisChangeList"></cdfs-his-task-change-list>
        <!--比对结果-->
        <cdfs-bank-comparison-list :taskNo="comparsionTaskNo" :drawer="showComparsionFlag" @close="hideComparsion"></cdfs-bank-comparison-list>
        <!-- 差错登记-->
        <error-info-list :taskNo="errorInfoTaskNo" :drawer="showErrorInfoListFlag" @close="hideErrorInfoList"></error-info-list>
        <!-- 同客户多保单-->
        <cdfs-two-case-list :taskno="twoCaseTaskno" :applnum="twoCaseApplNum" :drawer="showTwoCaseListFlag" @close="hideTwoCaseList"></cdfs-two-case-list>
        <!--影像列表-->
        <cdfs-image-list :drawer="showImageFlag" :applnum="showImageApplnum" @close="hideImageList"></cdfs-image-list>
    </div>

</template>

<script>
    import {mapGetters} from 'vuex'
    import {page} from "@/api/taskCenter/bankTask";
    import {cdfsExchangeNode, getNextNodes, getNodeMap, getSsyOrgMap,getDocTypeMap,
        warnOrTimeOutCount,cdfsLock,cdfsUnlock,cdfsHisUnlock,cdfsHisLock,getCdfsAuthCode} from "@/api/taskCenter/taskCommon";
    import constant from '@/utils/constant';
    import taskConstants, {getSelectList} from '@/utils/taskConstants';
    import CdfsTaskChangeList from "../CdfsTaskChangeList";
    import CdfsRemarkList from "../cdfsRemarkList";
    import CdfsBankComparisonList from "./CdfsBankComparResultList";
    import CdfsHisTaskChangeList from "../CdfsHisTaskChangeList";
    import CdfsHisRemarkList from "../cdfsHisRemarkList";
    import ErrorInfoList from "../errorInfoList";
    import CdfsTwoCaseList from "../cdfsTwoCaseList";
    import CdfsImageList from "@/page/common/cdfsImageList";

    export default {
        components: {
            CdfsHisRemarkList,
            CdfsHisTaskChangeList,
            CdfsBankComparisonList,
            CdfsTaskChangeList,
            CdfsRemarkList,
            ErrorInfoList,
            CdfsTwoCaseList,
            CdfsImageList,
        },
        data() {
            return {
                warnCount: 0,//预警个数
                ssyMap: {},//机构对象
                nodeMap: {},//节点对象
                docTypeMap: {},//文件类型对象
                nextNodeMap: {},
                flag06s:[],
                bankRiskType:[],
                showNext:false,
                isShow: false,
                remarkTaskNo: "",
                showRemarkFlag: false,
                hisRemarkTaskNo: "",
                showHisRemarkFlag: false,
                changeTaskNo: "",
                showChangeFlag: false,
                hisChangeTaskNo: "",
                showHisChangeFlag: false,
                showAddRenewalFlag: false,
                comparsionTaskNo: "",
                showComparsionFlag: false,
                errorInfoTaskNo: "",
                showErrorInfoListFlag: false,
                twoCaseApplNum: "",
                twoCaseTaskno: "",
                showTwoCaseListFlag: false,
                showImageFlag:false,
                showImageApplnum:'',
                // 查询条件
                rules: {
                    caseno: [{
                        pattern: /^[0-9]*$/,  //正则
                        message: '受理号只能输入数字'
                    }],
                    schdrnum: [{
                        pattern: /^[0-9]*$/,  //正则
                        message: '保单号只能输入数字'
                    }],
                    sgroupno: [{
                        pattern: /^[0-9]*$/,  //正则
                        message: '组号只能输入数字'
                    }],
                    channel: [],
                    taskRank: [],
                    markNo: [],
                    institution: [],
                    acceptdate: [],
                    order: []
                },
                searchParams: {
                    pool: taskConstants.bankPoolType.hbybdo,//
                    scompanyid: "",//
                    srisk: "",//
                    caseno: "",//
                    schdrnum:"",
                    sgroupno: "",//
                    pageSize: "",
                    pageNumber: "",
                },
                orderList: constant.order,
                multipleTable: [],
                tableData: [],
                loading: false,
                //需要给分页组件传的信息
                paginations: {
                    total: 0,        // 总数
                    pageIndex: 1,  // 当前位于哪页
                    pageSize: 10,   // 1页显示多少条
                    pageSizes: [5, 10, 15, 20],  //每页显示多少条
                    layout: "total, sizes, prev, pager, next, jumper"   // 翻页属性
                },
                pickerOptions1: {
                    disabledDate(time) {
                        return time.getTime() > Date.now();
                    }
                },
                isFirstEnter:false,
            }
        },
        created() {
            if (this.$route.path == "/home/taskCenter/bank/nbPendingList"){
                console.log("新契约待处理");
                this.searchParams.pool = taskConstants.bankPoolType.hbybdo;
            }
            if (this.$route.path == "/home/taskCenter/bank/nbZhaohuiList"){
                console.log("新契约照会待回复");
                this.searchParams.pool = taskConstants.bankPoolType.hbybzh;
            }
            if (this.$route.path == "/home/taskCenter/bank/nbEndList"){
                console.log("end单");
                this.searchParams.pool = taskConstants.bankPoolType.yb_end;
            }

            this.nextNodes();
        },
        activated() {
            this.getList();
            document.onkeydown = (event)=>{
                var e = event || window.event || arguments.callee.caller.arguments[0];
                if (e && e.keyCode == 113) {
                    this.getList();
                }
            };
        },
        mounted() {
            setTimeout(()=>{
                this.isFirstEnter=true;
            },100)
            getSsyOrgMap().then(data => this.ssyMap = data);
            this.bankRiskType = getSelectList(taskConstants.bankRiskType);
        },
        methods: {
            getIsFlag01(row, column, cellValue, index) {
                if (cellValue == '') {
                    return cellValue;
                } else if (cellValue == 'N') {
                    return "";
                } else if (cellValue == 'Y') {
                    return "是";
                } else {
                    return "异常数据";
                }
            },
            getIsFlag03(row, column, cellValue, index) {
                if (cellValue == '') {
                    return cellValue;
                } else if (cellValue == '0') {
                    return "否";
                } else if (cellValue == '1') {
                    return "是";
                } else {
                    return "异常数据";
                }
            },
            getOrgName(value) {
                for (let key in this.ssyMap){
                    if (this.ssyMap[key]["sorgid"] && this.ssyMap[key]["sorgid"] == value){
                        value = this.ssyMap[key]["sorgname"]
                        break;
                    }
                }
                return value;
            },
            getNodeName(value) {
                if (this.nodeMap && this.nodeMap["YBNB" + "_"+ value] && this.nodeMap["YBNB" + "_"+ value].content)
                    return this.nodeMap["YBNB" + "_"+ value].content;
                else
                    return value;
            },
            showRemark(taskNo) {
                if (this.searchParams.pool == taskConstants.bankPoolType.yb_end){
                    this.showHisRemark(taskNo);
                }else {
                    this.remarkTaskNo = taskNo;
                    this.showRemarkFlag = true;
                }
            },
            showChange(taskNo) {
                if (this.searchParams.pool == taskConstants.bankPoolType.yb_end){
                    this.showHisChangeList(taskNo);
                }else {
                    this.changeTaskNo = taskNo;
                    this.showChangeFlag = true;
                }
            },
            hideRemark() {
                this.remarkTaskNo = "";
                this.showRemarkFlag = false;
            },
            showHisRemark(taskNo) {
                this.hisRemarkTaskNo = taskNo;
                this.showHisRemarkFlag = true;
            },
            hideHisRemark() {
                this.hisRemarkTaskNo = "";
                this.showHisRemarkFlag = false;
            },
            hideChange() {
                this.changeTaskNo = '';
                this.showChangeFlag = false;
            },
            showorhide() {
                this.isShow = !this.isShow;
            },
            showAddRenewal() {
                this.showAddRenewalFlag = true;
            },
            hideAddRenewal() {
                this.showAddRenewalFlag = false;
            },
            showComparsion(taskNo) {
                this.comparsionTaskNo = taskNo;
                this.showComparsionFlag = true;
            },
            hideComparsion() {
                this.comparsionTaskNo = "";
                this.showComparsionFlag = false;
            },
            showHisChangeList(taskNo) {
                this.hisChangeTaskNo = taskNo;
                this.showHisChangeFlag = true;
            },
            hideHisChangeList() {
                this.hisChangeTaskNo = "";
                this.showHisChangeFlag = false;
            },
            showErrorInfoList(taskno) {
                //通过字典明细表中定义的sdd_code列名称获取第三方平台路径
                const appContextUrl = JSON.parse(sessionStorage.getItem(constant.APP_CONTEXT_URL));
                if (appContextUrl == null) {
                    this.$message.error("请重新登录后重试！");
                    return;
                }
                const citicgis = appContextUrl['CITICGIS'];
                getCdfsAuthCode().then(res => {
                    if (res.resultCode == constant.SUCCESS && res.data) {
                        let href = citicgis + `/mistakeManager?requestType=list&authCode=${res.data.authCode}&loginUserId=${res.data.userId}&taskno=${taskno}`;
                		window.open(href,'_blank');
                    }else {
                        this.$message.error(res.resultMsg);
                    }
                }).catch(error => {
                    this.$message.error("获取CDFS差错登记出错");
                });
            },
            showTwoCaseList(taskno,applnum) {
                this.twoCaseTaskno = taskno;
                this.twoCaseApplNum = applnum;
                this.showTwoCaseListFlag = true;
            },
            hideTwoCaseList() {
                this.twoCaseTaskno = '';
                this.twoCaseApplNum = '';
                this.showTwoCaseListFlag = false;
            },
            showImageList(applnum) {
                this.showImageApplnum = applnum;
                this.showImageFlag = true;
            },
            hideImageList() {
                this.showImageApplnum = '';
                this.showImageFlag = false;
            },
            // 查询列表
            getList() {
                //获取预警任务个数
                this.queryWarnCount();
                this.paginations.total = 0;
                this.tableData = [];
                 this.$store.dispatch('loading/CHANGE_LOADING',true)
                this.searchParams.pageNumber = this.paginations.pageIndex;
                this.searchParams.pageSize = this.paginations.pageSize;
                page(this.searchParams).then(res => {
                    console.log('参数', this.searchParams);
                    console.log('结果', res);
                     this.$store.dispatch('loading/CHANGE_LOADING',false)
                    if (res.resultCode == constant.SUCCESS && res.data && res.data.list.length) {
                        this.paginations.total = res.data.total;
                        this.tableData = res.data.list;
                        this.tableData.forEach(item => {
                            item["orgName"] = this.getOrgName(item.scompanyid);
                            item["nodeName"] = this.getNodeName(item.srouteid);
                        })
                    }

                }).catch(err => {
                     this.$store.dispatch('loading/CHANGE_LOADING',false);
                })
            },
            //查询预警个数
            queryWarnCount() {
                /*let routeids = "";
                if (this.searchParams.routeid == '') {
                    routeids = taskConstants.RouteId.renewal_hebao + "," + taskConstants.RouteId.renewal_zhhf
                }
                this.warnCount = 0;
                warnOrTimeOutCount(taskConstants.taskBusitype.REAL, routeids).then(res => {
                    console.log('结果', res);
                    // this.$store.dispatch('loading/CHANGE_LOADING',false)
                    if (res.resultCode == constant.SUCCESS && res.data) {
                        this.warnCount = res.data;
                    }
                }).catch(err => {
                    // this.$store.dispatch('loading/CHANGE_LOADING',false);
                })*/
            },
            //获取核保、照会回复的下一节点
            nextNodes() {
                    //理赔二核
                    getNextNodes(this.searchParams.pool,taskConstants.taskBusitype.YBNB).then(res => {
                        // this.$store.dispatch('loading/CHANGE_LOADING',false)
                        if (res.resultCode == constant.SUCCESS) {
                            res.data.forEach(item => {
                                this.nextNodeMap[item.destNode] = item;
                            });
                            this.showNext = true;
                        }
                    }).catch(err => {
                        // this.$store.dispatch('loading/CHANGE_LOADING',false);
                    });
            },
            //任务流转
            exchangeNode(routeid) {
                this.$store.dispatch('loading/CHANGE_LOADING',true);
                let arr = [];
                this.$refs.multipleTable.selection.forEach(item => {
                    arr.push(item.staskno);
                });
                if (arr.length <= 0) {
                    this.$message.error("请选择任务！");
                    this.$store.dispatch('loading/CHANGE_LOADING',false);
                    return;
                }
                cdfsExchangeNode(arr, routeid).then(res => {
                    this.$store.dispatch('loading/CHANGE_LOADING',false)
                    if (res.resultCode == constant.SUCCESS) {
                        this.getList();
                    } else {
                        this.$alert(res.resultMsg, '错误信息', {
                            confirmButtonText: '确定',
                            callback: action => {
                                this.$message({
                                    type: 'error',
                                    message: `action: ${action}`
                                });
                            }
                        });
                        this.getList();
                    }
                }).catch(err => {
                     this.$store.dispatch('loading/CHANGE_LOADING',false);
                })
            },
            //加锁
            lock() {
                this.$store.dispatch('loading/CHANGE_LOADING',true);
                let arr = [];
                this.$refs.multipleTable.selection.forEach(item => {
                    arr.push({staskno:item.staskno,srcNode:item.srouteid});
                });
                if (arr.length <= 0) {
                    this.$message.error("请选择任务！");
                    this.$store.dispatch('loading/CHANGE_LOADING',false);
                    return;
                }
                if (this.searchParams.pool == taskConstants.bankPoolType.yb_end){
                    cdfsHisLock(arr).then(res => {
                        this.$store.dispatch('loading/CHANGE_LOADING',false);
                        if (res.resultCode == constant.SUCCESS) {
                            this.getList();
                        } else {
                            this.$alert(res.resultMsg, '错误信息', {
                                confirmButtonText: '确定',
                                callback: action => {
                                    this.$message({
                                        type: 'error',
                                        message: `action: ${action}`
                                    });
                                }
                            });
                        }
                    }).catch(err => {
                        this.$store.dispatch('loading/CHANGE_LOADING',false);
                    })
                }else {
                    cdfsLock(arr).then(res => {
                        this.$store.dispatch('loading/CHANGE_LOADING',false);
                        if (res.resultCode == constant.SUCCESS) {
                            this.getList();
                        } else {
                            this.$alert(res.resultMsg, '错误信息', {
                                confirmButtonText: '确定',
                                callback: action => {
                                    this.$message({
                                        type: 'error',
                                        message: `action: ${action}`
                                    });
                                }
                            });
                        }
                    }).catch(err => {
                        this.$store.dispatch('loading/CHANGE_LOADING',false);
                    })
                }
            },
            //解锁
            unlock() {
                this.$store.dispatch('loading/CHANGE_LOADING',true);
                let arr = [];
                this.$refs.multipleTable.selection.forEach(item => {
                    arr.push(item.staskno);
                });
                if (arr.length <= 0) {
                    this.$message.error("请选择任务！");
                    this.$store.dispatch('loading/CHANGE_LOADING',false);
                    return;
                }
                if (this.searchParams.pool == taskConstants.bankPoolType.yb_end){
                    cdfsHisUnlock(arr).then(res => {
                        this.$store.dispatch('loading/CHANGE_LOADING',false)
                        if (res.resultCode == constant.SUCCESS) {
                            this.getList();
                        } else {
                            this.$alert(res.resultMsg, '错误信息', {
                                confirmButtonText: '确定',
                                callback: action => {
                                    this.$message({
                                        type: 'error',
                                        message: `action: ${action}`
                                    });
                                }
                            });
                        }
                    }).catch(err => {
                        this.$store.dispatch('loading/CHANGE_LOADING',false);
                    })
                }else {
                    cdfsUnlock(arr).then(res => {
                        this.$store.dispatch('loading/CHANGE_LOADING',false)
                        if (res.resultCode == constant.SUCCESS) {
                            this.getList();
                        } else {
                            this.$alert(res.resultMsg, '错误信息', {
                                confirmButtonText: '确定',
                                callback: action => {
                                    this.$message({
                                        type: 'error',
                                        message: `action: ${action}`
                                    });
                                }
                            });
                        }
                    }).catch(err => {
                        this.$store.dispatch('loading/CHANGE_LOADING',false);
                    })
                }
            },
            // 每页多少条切换
            handleSizeChange(pageSize) {
                this.paginations.pageSize = pageSize;
                this.getList();
            },
            // 上下分页
            handleCurrentChange(page) {
                this.paginations.pageIndex = page;
                this.getList();
            },
            // 根据条件查询列表
            subGetList() {
                this.paginations.pageIndex = 1;
                this.getList();
            },

            handleSelectionChange(val) {
                this.multipleSelection = val;
            },

            // 清除查询条件
            resetSearch() {
                this.searchParams.sgroupno = '';
                this.searchParams.schdrnum = '';
                this.searchParams.scompanyid = '';
                this.searchParams.srisk = '';
                this.searchParams.caseno = '';
                this.$refs.multipleTable.clearSort();
            },
            //预警
            rowStyle({row, rowIndex}){
                if (row.clorFlag == '1'){
                    return "color:blue !important";
                }else if(row.clorFlag == '2'){
                    return "color:red !important";
                }else if(row.clorFlag == '3'){
                    return "color:green !important";
                }else {
                    return "";
                }
            },
            // vip权限拦截
            interceptVip(row, index) {
              let rowStr = JSON.stringify(row);
              if (rowStr.indexOf("*") > -1) {
                return false;
              }
              return true;
            },
        },
        watch: {
            ssyMap: function (newVal) {
                console.log(newVal);
                console.log(this.ssyMap);
                //重新渲染table
                this.tableData.forEach(item => {
                    item["orgName"] = this.getOrgName(item.scompanyid);
                });
                this.tableData.push({});
                this.tableData.pop();
                console.log(this.tableData);
                console.log("重新渲染table");
            },
            nodeMap: function (newVal) {
                //重新渲染table
                this.tableData.forEach(item => {
                    item["nodeName"] = this.getNodeName(item.srouteid);
                });
                this.tableData.push({});
                this.tableData.pop();
                console.log(this.tableData);
                console.log("重新渲染table");
            },
        },
        computed: {
            ...mapGetters(['tags']),
        },

    }
</script>

<style lang="less" scoped>
    .fillcontain {
        padding-bottom: 0;

        .fastQuery {
            padding: 15px 20px 10px 20px;
            background: #fff;
            border-bottom: 1px solid #e1e1e1;

            .fastQuery_title {
                color: #666;
                padding: 6px 0px;
            }

            .fastQuery_item {
                margin: 0 10px;
            }

            .item_default {
                .el-button {
                    color: #409EFF !important;
                    border-color: #c6e2ff !important;
                    background-color: #ecf5ff !important;
                }

            }

            .moreCondition {
                color: #68a3fc;
                cursor: pointer;
                padding: 6px 0px;

                .el-icon-d-arrow-right {
                    transform: rotate(90deg);
                }

                .el-icon-d-arrow-left {
                    transform: rotate(-90deg);
                }
            }
        }
    }

    .contain {
        background: #fff;
        padding: 10px;
        margin-bottom: 20px;
    }

    .pagination {
        padding: 10px 20px;
        text-align: right;
    }

    .operationIcon {
        // padding: 12px;
        border: 1px solid #e5e5e5;
        border-radius: 50%;
        width: 22px;
        height: 22px;
        display: inline-block;
        cursor: pointer;
        box-shadow: 0 0 3px #f9f9f9;

        .svg-icon {
            font-size: 14px;
            fill: #68a3fc;
        }
    }

    .search_container {
        padding: 20px 20px 0 20px;
    }

    .el-dropdown {
        vertical-align: top;
    }

    .el-dropdown + .el-dropdown {
        margin-left: 15px;
    }

    .el-icon-arrow-down {
        font-size: 12px;
    }
</style>



